package com.gui.consistency.web;

import com.gui.common.Result;
import com.gui.consistency.service.ConsistencyService;
import com.gui.entity.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/consistency")
@RestController
public class ConsistencyController {

    @Autowired
    private ConsistencyService consistencyService;


    @RequestMapping(value = "/query/{id}", method = RequestMethod.GET)
    public Result<Person> query(@PathVariable Integer id){
        Person person = consistencyService.query(id);
        return Result.success(person);
    }

    @RequestMapping(value = "/deleteUpdate", method = RequestMethod.POST)
    public Result<String> deleteUpdate(@RequestBody Person person){
        consistencyService.deleteUpdate(person);
        return Result.success();
    }
}
